<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: hiugiak
  Date: 2018-12-13
  Time: 14:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>毕业设计指导网站 - 消息中心</title>

    <jsp:include page="../../includes/framework-headers.jsp" />
    <c:choose>
        <c:when test="${sessionScope.user.getUserType() == 'A'}">
            <jsp:include page="../../includes/framework-navbar-admin.jsp" />
        </c:when>
        <c:when test="${sessionScope.user.getUserType() == 'S'}">
            <jsp:include page="../../includes/framework-navbar-student.jsp" />
        </c:when>
        <c:when test="${sessionScope.user.getUserType() == 'T'}">
            <jsp:include page="../../includes/framework-navbar-teacher.jsp" />
        </c:when>
    </c:choose>

    <script src="../../../js/shared/inbox.js"></script>

    <style type="text/css">
        dt {
            padding: 10px 0!important;
        }
    </style>
</head>
<body>
<div class="gpg-middle">
    <div class="uk-container uk-container-center">
        <div class="uk-grid" data-uk-grid-margin style="margin: 20px">
            <div class="uk-width-medium-1-5 uk-grid-margin uk-hidden-small uk-padding-remove">
                <div class="uk-panel uk-panel-box">
                    <ul class="uk-nav uk-nav-side uk-nav-parent-icon" data-uk-nav="">
                        <li class="uk-nav-header">消息中心</li>
                        <li class="uk-active"><a href="${pageContext.request.contextPath}/inbox?mode=U">未读</a></li>
                        <li><a href="${pageContext.request.contextPath}/inbox?mode=R">已读</a></li>
                        <li><a href="${pageContext.request.contextPath}/inbox?mode=A">所有</a></li>
                    </ul>
                </div>
            </div>
            <div class="uk-width-medium-4-5">

                <article class="uk-article">
                    <dl class="uk-description-list-line">
                        <c:forEach var="message" items="${messageList}">
                            <c:if test="${message.status == '0'}">
                                <dt>${message.content}</dt>
                                <dd>
                                    <p class="uk-article-meta"><fmt:formatDate value="${message.sendTime}" pattern="yyyy-MM-dd HH:mm:ss"/> | ${message.fromUserName}
                                        <button class="uk-button uk-button-small uk-button-link uk-align-right btn-mark-read" data-message-id="${message.messageId}">
                                            <i class="uk-icon-check-circle-o"></i> 标记为已读
                                        </button>
                                    </p>
                                </dd>
                            </c:if>
                        </c:forEach>
                    </dl>
                </article>
            </div>
        </div>
    </div>
</div>
</body>
</html>
